import { Component, OnInit } from '@angular/core';
import { Observable } from "rxjs";
import { Joke, JokeService } from "../joke.service";

@Component({
  selector: 'app-joke-list',
  templateUrl: './joke-list.component.html',
  styleUrls: ['./joke-list.component.scss']
})
export class JokeListComponent implements OnInit {
  jokes: Array<Joke>;
  jokes$: Observable<Array<Joke>>;
  constructor(
    private jokeService: JokeService
  ) { }

  ngOnInit() {
    this.jokes$ = this.jokeService.jokes_hot;

//    this.jokeService.jokes_hot.subscribe(res => {
//      this.jokes = res.map(item => item)
//    });
  }

}
